import 'package:date_format/date_format.dart';
import 'package:flutter/material.dart';
import 'package:s_mankey/config/resource_mananger.dart';
import 'package:s_mankey/provider/provider_widget.dart';
import 'package:s_mankey/service/smonkey_repository.dart';
import 'package:s_mankey/ui/widget/home_car_widget.dart';
import 'package:s_mankey/view_model/home_vmodel.dart';

class Enterprise extends StatefulWidget {

  final datas;

  Enterprise({this.datas});

  @override
  _Enterprise createState() => _Enterprise();
}


class _Enterprise extends State<Enterprise> {

  @override
  void initState() {
    super.initState();
  }


  @override
  Widget build(BuildContext context) {
    return Stack(
        children: [
          HomeCardWidget(
            child: Padding(
              padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
              child: Column(
                children: [
                  /// 公司名称
                  Row(
                    children: [
                      ClipOval(
                        child: Image.network(
                          widget.datas['company_logo'],
                          height: 35,
                          width: 35,
                          fit: BoxFit.cover,
                        ),
                      ),
                      Expanded(
                        child: Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Text(
                            widget.datas['company_title'],
                            style: TextStyle(
                                color: Color(0xff2b2b2b),
                                fontSize: AppFontSize.Size14),
                          ),
                        ),
                      ),
//                      Container(
//                        decoration: BoxDecoration(
//                            gradient: AppColor.gradientColor,
//                            borderRadius: BorderRadius.circular(10)),
//                        child: Container(
//                            margin: EdgeInsets.fromLTRB(10, 5, 10, 5),
//                            child: Text(
//                              '查看更多',
//                              style: TextStyle(
//                                  fontSize: AppFontSize.Size12,
//                                  color: Colors.white),
//                            )),
//                      ),
                    ],
                  ),
//      中
                  ///内容
                  Padding(
                    padding: const EdgeInsets.fromLTRB(
                        0, AppPadding.Padding10, 0, AppPadding.Padding10),
                    child: Text(
                      widget.datas['company_brief'],
                      style: TextStyle(
                          fontSize: AppFontSize.Size14,
                          color: Color(0xff9fa9b4)),
                    ),
                  ),

                  ///图片
                  Container(
                    height: 80,
                    child: GridView.builder(
                      physics: NeverScrollableScrollPhysics(),
                      itemCount: widget.datas['image'].length,
                      gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                          crossAxisSpacing: 5,
                          crossAxisCount: 4),
                      itemBuilder: (BuildContext context, int index) {
                        return Image.network(
                          widget.datas['image'][index],
                          height: 55,
                          width: 55,
                          fit: BoxFit.cover,
                        );
                      },
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      );


  }

}